home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Newsletters
/
GEnieUnixNews
/
unxnl-11.92
< prev
next >
Wrap
Text File
|
1992-12-27
|
37KB
|
843 lines
_ _ _ _ _ _
// // //| // // \// N E W S
//_// // |// // /\\ Vol 3, Issue 7 - November 1992
R o u n d T a b l e (tm)
Items of interest to participants of the GEnie Unix RoundTable
The RoundTable SysOps are:
Andy Finkenstadt....ANDY Rick Mobley.........LRARK
Gary Smith..........GARS Brian Riley.........DELPHI
Mike Nolan..........MIKE.NOLAN All Unix SysOps.....UNIX$
We strongly encourage you to contact any or all of us if you have -ANY-
comments or suggestions. This is -YOUR- RoundTable. We are here to make
your participation as pleasant and beneficial as possible.
ED: editor notes - (GARS) Gary Smith
==
Your Unix resource center on GEnie continues growing to meet your
needs. Fellow SysOp Rick Mobley has completed a sweep of new maps.
Scanning the map entries for your state/area (or province) should provide
those of you needing uucp/net access with contacts. Please do remember
to exercise the gracious side of your social skills when approaching
anyone for help <grin>.
Mike McCabe and Lance Mehle have been busy building a Soft Landing
System for Linux users, and the Linux files themselves continue to build.
If you have a 386 platform these files provide all the tools you need
for a complete Unix-like system. Check out software library 30 to see
the latest resources for Linux/SLS.
We have had the good fortune of having several skilled individuals come
on board as assistants. You will be meeting them over the course of the
next few newsletters in the "WHO" topic. Please avail yourself of their
skills. Also, remember they are volunteers. They are giving of themselves
as a matter of choice. We deeply appreciate their help and hope you will,
as well.
The library has been expanded to include a FTP file listings and requested
downloads sections, libraries 41 and 42 respectively. These afford you the
opportunity to request files to be posted we might not otherwise consider
in our already prodigious file collection.
This is your Unix RoundTable. Let us know what else is needed to meet
your needs. Use the FEEDBACK item in the menu or leave email to UNIX$.
WHO: Biographical Sketches
===
K.SMITH52 (Keith E. Smith) SCO/DataComm Guru (and we call him an assistant!)
--------------------------
I am currently a full time Unix Programmer and part time Unix Systems
Consultant in Eastern North Carolina. My emphasis is on SCO based
systems and systems hardware in business environments. I'm reasonably
proficient in 'C' and most common *IX based utilities, and have experience
with a wide array of SCO Unix and Xenix hardware configurations and
applications. My strengths are generally "gluing" together odds and ends
hardware and software and making it work.
I'm also familiar with DEC mini's, and IBM Midrange (OCL/RPG, yes, I
know it was wrong but I compiled too!)
JANS (Janet McNeely) Bulletin Board Broom lady (person)
--------------------
I'm a secretary by profession with only a minor introduction
to Unix years ago, interrupted by a 13 year significant relationship
with MS-DOS applications. I'm learning Unix again, slowly, but
under excellent tutelage (from GARS). I've done some editing in
my time, and that's what I'm going to be doing in the Unix BB--
mostly pruning topics and moving them to the Library, and, I hope,
encouraging increased participation in topics that have become
inactive.
Lead Sysop Notes (ANDY) Andrew Finkenstadt
================ Chief Sysop
The Unix RT is expanding. We've reached the one year anniversary of my
tenure quietly last month, and boy, have we been busy. You can take pride
in being a part of one of the fastest growing areas of GEnie.
Last month we had the MOST number of new files uploaded (248), and the most
number of bytes (34 megabytes) ever in the history of the RoundTable. And
with the recent announcement and enactment of the Anonymous FTP service, in
the first 3 days of November alone has had uploaded 9 megabytes and 31
files. Wow!
We've also quietly made a change that we think serves you better - we used
to upload many part shars as a compressed tar archive of the shar
postings. Most of our recent uploads from the Usenet source groups and
other places (gnu stuff) are actually compressed tar archives of the Files
themselves. This means that there's less work after downloading, and
easier portability across platforms.
Also you may have noticed that files are longer now, and not in multi-part
pieces as often as they were before. This is because GEnie has changed
over the past years. Zmodem allows one to resume in the middle of any kind
of crashed download without losing data, and general reliability has
increased.
Our conference (real time messaging) schedule has expanded with the
addition of a dedicated Linux, Coherent and other inexpensive alternative
operating systems to Unix night - Friday nights at 11pm EST until around
1am. Lex Rheaume will be your host on that night, along with some of your
other friends from GEnie. Eric Tremblay, that active guy posting all about
the NeXT is hosting a NeXT Night on Monday nights for those who might want
to do something while Monday Night Football is on. It's at 10pm EST until
11:30pm or so. And our Thursday & Sunday night Help Desks continue in the
Chat Lines channel #4. Lots of people come by during those hours to ask
about Linux and how to configure mail and news and other common and
not-so-common questions.
The full schedule is posted on the Unix "front door" as you move to page
160.
We now offering on a trial basis a service for persons wanting access to
some Internet services that aren't offered on GEnie at this time: anonymous
FTP.
What is anonymous FTP you ask? Basically - if you know a file is out there
on the INTERNET, perhaps through reading about it on a mailing list or from
a GEnie bulletin board, but can't find it already on GEnie in the
appropriate places, just post a note in the Unix bulletin board category 1
topic 8 and we'll go find it and make it available to you for downloading
in our special library #42. If you aren't sure where exactly it is or want
to know "everything" that's in a specific place, scan library #41 for FTP
file listings. That's where we'll put by-request directories of files.
The files placed in library #42 will be removed after a short period of
time to the appropriate RoundTables on GEnie, so if you are looking for
interesting files to snarf, make sure you check that library for new
entries at least weekly.
The usenet map files have been updated and we've added Canada in the
process. If you are looking for your own Usenet "feed" then the map files
are the place to start.
Mike Nolan, one of your Sysops in the Unix RT, has taken over management of
the Database Management Systems Roundtable on GEnie. The DBMS RT, on page
485, will be THE place to talk about all kinds of databases, personal file
managers, CASE tools, and the like. Congratulations Mike. (Mike immediately
drafted me to help him out there, so I'm now an assistant in DBMS, too.)
And last but not least - GEnie has announced the PUBLIC and OPEN Beta
testing of its Internet Mail Gateway for U.S. Billed customers. You may
remember in my letter from August that the gateway was in beta testing. At
monthly charge in addition to per-item charges. Now there is a one-time
registration fee which enables your mail address to receive Internet mail,
plus a reduced per-item fee based on the size of the item you send or Unix
RT sponsors two nights a week of INTERNET Help Desks in the Chat Lines on
page 400.)
NeXT Column
===========
Will you open the NeXTwindow of opportunity?
Eric "E.T." Tremblay
Having a NeXT computer opens many new possible opportunities. As a
programmer I see many markets that are still untapped. The market I see
great potential in developing is games. It might seem unusual to associate
a NeXT workstation with entertainment software. Yes, it is true that games are
not the reason people or companies purchase NeXTs. It is still true that
games have a market and a place with the NeXT computers. Just because
someone bought a NeXT for work does not mean he would not like to play a
game on his machine, especially if the NeXT is the only machine there.
Everyone including owners of NeXT computers need a little break and a little
entertainment once in a while.
The reason why I am interested in games for the NeXT is that the market
is still virgin in that area. There are at this writing only two commercial
offerings of games for the NeXT. These games are 'Culture Shock', which is a
shanghai type card game, and there is 'Ragnarok', which is based on an old
viking board game. So this leaves a lot of space for a small developer to
market a game and get instant recognition for his product. Unlike other
platforms which have such intense competition, it is very difficult for a
small company or developer to distinguish his product from the others. It is
interesting to know that there are rumors circulating to the effect that Maxis
will port SimCity to the NeXT. The Sun version will be out soon, giving the
rumor a lot of credibility.
What triggered this interest for games on the NeXT? The first reason
is my personal quest for entertainment. The second is a statement from a
salesman at NeXTConnection saying "There is a huge lack in games for the
NeXT. The demand is there but unfortunately the products are not there to
take advantage of that demand."
The point of this article is to simply make the reader aware that
there are great opportunities and potential with the NeXT computer. Either
from the users point of view of using great software or from the developers
point of view of having a great tool on which he can create excellent
application and market them with relative ease compared to the other
platforms.
There are many unfulfilled opportunities that many smart people will
take advantage of in the near future. The first smart thing to do is
purchase a NeXT. The second one is making money with it. Are you ready and
willing to open the NeXTwindow of opportunity?
(This article is a reprint from the September 1992 issue of Interface
Magazine published by Le Club Macintosh de Montreal, 2250, rue Guy,
suite 303, Montreal, H2H 2N2.)
Down and Dirty: Quick Scripts that do something useful
==============
Article 4958 of comp.unix.shell:
From: dchouina@sobeco.com (Daniel Chouinard)
Newsgroups: comp.unix.questions,comp.unix.shell
Subject: Re: How do I do this in 'sh'
Message-ID: <1992Jun15.224408.19290@sobeco.com>
Date: 15 Jun 92 22:44:08 GMT
References: <18218@fritz.filenet.com>
Organization: Sobeco Ernst & Young
Lines: 92
In <18218@fritz.filenet.com> scotth@felix.filenet.com (Scott Hopson) writes:
>How would you do "EXACTLY" what this script does using "sh". Please take care
>to look at the last parm of the "mv" command. I need to have the leading path
>info removed from the $FILE variable so the only thing left is the filename.
>----------------------------------------------------------------------------
>#!/bin/csh
># This script removes a file(s) and places them in the $HOME/.trash directory
># the times get changed and the file has a number appended to make it unique.
># Later a cron process runs which removes the files that are more than 3 days
># old.
>foreach FILE ($*)
> if ( -e $FILE == 1) then
> touch $FILE
> mv -f $FILE $HOME/.trash/$FILE:t.$$
> endif
> shift
>end
>----------------------------------------------------------------------------
>This script works but I'd like to use Bourne Shell instead of C-Shell.
>I use this script to replace the "rm" command. It's in $HOME/bin, my path is
>set as follows: set path = (. $HOME/bin /bin /usr/bin ... and so on)
>This way it gets called before /bin/rm, then I just "alias erase /bin/rm" so
>I still have /bin/rm available.
> Thanks,
> Scott
>--
>Scott Hopson (scotth@filenet.com)
>"C is not a block-structured language in the sense of PL/1 or Algol
-- K&R 4.8"
I have two scripts for you. trash and untrash. Here's trash:
#!/bin/sh
# trash: remove files and/or directory trees and puts them in cpio format in
# $HOME/.trash
echo "Background remove in progress..."
for a in $* ; do
if [ ! -r $a ]; then
echo "Can't find $a" >&2
else
c=`basename $a`
e=$c
b=0
while [ -f $HOME/.trash/$c ]; do
b=`expr $b + 1`
c=$e.$b
done
find $a -cpio $HOME/.trash/$c 2>/dev/null
rm -rf $a
fi
done &
And here's untrash:
#!/bin/sh
for a in $* ; do
if [ "$a" = "-l" ]; then
list=y
else
if [ "$list" = "y" ]; then
cpio -itvcI$HOME/.trash/$a 2>&1
else
cpio -iumdvcI$HOME/.trash/$a 2>&1
echo "\r\033[K$a->\c"
rm $HOME/.trash/$a
echo "Untrashed!"
fi
fi
done
What's neat about it is that whole directory structures can be removed at a
time, generates unique names (adding a suffix of .1, .2, .3... if necessary),
and untrash has a list argument that lists file contents.
Here's my crontab entry to remove files:
22 23 * * * find /homes/d.chouinard/.trash -mtime +2 -print -exec rm -f {} \;
The -print up there gives me a list of deleted files in my mail.
dchouina@sobeco.com
Daniel Chouinard
Sobeco Ernst & Young
Montreal, PQ, Canada.
Upload contest winners for September & October announced (ANDY)
========================================================
Congratulations to Lance Mehle & William Kubeck - for the month of October
they qualified as winners of one free day each for their new uploads. And
Congratulations to Dragons Eye. In September he qualified for BOTH free
days. Good work, gentlemen.
usr/local: Items (scripts and news) snarfed from various sources
=========
Unix(tm) News (DELPHI) Brian Riley
-------------
Korn does X-Windows:
Acacia Computer Agency has developed version 1.0 of it's
Windowing Korn Shell for Solaris on SPARC and Intel systems.
The product is also aimed at SunOs and Open Desktop. X-Windows
GUI's can be developed interactively using Windowing Korn Shell.
Unix meets Dos at WordPerfect:
WordPerfect Corp. has brought the Dos and Unix worlds closer
together when it released Word Perfect(tm) 5.1 for Solaris 2.0
on Sun workstations. Also scheduled are versions for AIX, SCO
Unix, SCO Xenix, HP-UX and 88open. Not only is this the same
version as is currently available for Dos and Windows, but, the
documents are compatible across the board AND the price is the
same!
USL composing "Mozart":
Unix Systems Laboratory plans, late this year, to release Unix
System V Release 4.3. SVR 4.3, code named Mozart, will merge the
development streams for the multiprocessing version, the secure
version and the desktop version in an effort to get Unix on a
single code stream.
Wang files Bankruptcy:
Financial troubles have forced Wang Laboratories to file for
Chapter 11 protection and reduce it's 13000 work force to 8000.
As a result of their $139 million loss Sun Microsystems will
replace Wang on the S&P 500 stock index. "Slow to adapt" was the
reason given for the company's problems.
Get Wyse to Unix:
Wyse Technology has introduced new systems aimed at the Unix
environment, including the 7000i model 740MP, the 9000i Model
960MP, the 6000i Model 645 and the Decision 486si. These 80486
based systems sport between one and eight 486 processors and up
to 384 megabytes of memory.
Tektronix aims Phaser at Unix workstations:
The Phaser IISD is a high end dye-sublimation printer features
a 24 Mhz AMD 29000 RISC processor, 16-64 megabytes of memory and
300 dpi resolution. Also available is Phaser Print software
that allows Unix workstation users to print raster and
PostScript Level 2 files on the Phaser IISD and other Adobe
PostScript printers.
3B1 vs 7300 hardware info snarfed from the net (GARS) Gary Smith
----------------------------------------------
Article 402 of comp.sys.3b1:
Path: lrark!ddi1!uunet!uunet!beartrk!ceilidh!hijo-2!dnichols
From: dnichols@ceilidh.beartrack.com (Don Nichols (DoN.))
Newsgroups: comp.sys.3b1
Subject: Re: More info about my troublesome 3b1
Message-ID: <1992Sep14.005530.12479@ceilidh.beartrack.com>
Date: 14 Sep 92 00:55:30 GMT
References: <1992Sep10.214017.1066@umbc3.umbc.edu>
Sender: news@ceilidh.beartrack.com (News)
Distribution: na
Organization: D & D Data
Lines: 151
Nntp-Posting-Host: pinata
In article <1992Sep10.214017.1066@umbc3.umbc.edu> hybl@umbc4.umbc.edu
(Dr. Albert Hybl (UMAB-BIOPHYS)) writes:
>
>This posting is in response to a mild scolding from a
>respondent: "It would have been nice to have an indication as
>to which version of O.S. you are running. (B.T.W. The [panic]
>messages vary with the version of the O.S.) Also, are you on a
>7300 or a 3b1? How much memory on the CPU card? Any extra
>memory? Any other cards present?"
Your following is an excellent listing of the important details.
>There are no cards in the expansion slots. There is 2Mb of
>memory on the motherboard. I am running 3.51m. The disk
>cntr is WD1010 and the motherboard is P3...P5. The machine
>was sold to me as a 3b1. It has the hump and a full height
>HD with 67 Mb of memory. The power supply is Model PS 1569
>that says it is a 7300 (3B1s use model PS 1610-1). Reading
>the FAQ description of the differences:
>
>"The 7300 machines featured 512k RAM on the motherboard with a
>10 or 20MB disk. The later 3B1 machines had 1M or 2M on the
>motherboard, and came with a 40 or 67MB disk. ... The 3B1 also
>has a heftier power supply." ARE THERE ANY OTHER DIFFERENCES
>BETWEEN A CPU MOTHERBOARD OF A 3B1 AND A 7300 BESIDES THE AMOUNT
>OF MEMORY? I assume not.
A 7300 cpu card will have two power connectors for the drives (one
for the floppy, and one for the hard drive). The 3b1 provides power for the
hard drive through wires directly from the power supply, without a side trip
through the cpu board. I have not explicitly checked a 3B1 motherboard for
the presence of the four solder pads in a row for the hard drive similar to
the floppy, but if it was a 7300 cpu board (with memory added) you would
either have the old connector and wires still present (and perhaps taped up,
as in the converted machine which I got at the hamfest today), or they would
probably show signs of the wires having been unsoldered. (This would
include the holes being empty after being cleaned by a solder sucker, since
the machine was wave soldered, the holes would normally be filled with
solder, even if nothing was there.)
>It seems that I have either an under powered 3b1 or a memory enhanced
>7300. I plan to add a 2Mb memory expansion board and a STARLAN
>board. WILL THE PS-1569 POWER SUPPLY BE A PROBLEM?
Check that the power supply has been modified to route power
directly to the hard drive by soldering wires to the holes adjacent to the
D.C. power connector. While you are there, also check for signs of
overheating of any of the pins in the D.C. connector on the ribbon cable
from the cpu. If this has been the case, then the plastic is usually
discolored (browned) where that pin is. A frequent source of hard disk
problems, panics, etc, is one pin in the D.C. connector getting oxidized,
and introducing reduced voltage to the cpu board, and variations in the
voltage, which can cause some *very* strange malfunctions.
>Since my first post I have had several panic messages,
>one with trap vector 11 followed by a "Double panic" with
>trap vector 1 after which the system did not reboot
"Double Panic" means that the kernel hit a second panic while trying
to deal with the first one, and just gave up entirely.
>and the monitor only displayed the green screen:
>--__--__--__--__--__ etc.to the end of a line
>--__--__--__--__--__
>--__--__--__--__--__
>--__--__--__--__--__
>The lines on the screen are very close together and the pattern
>fills the screen. (The -- are true lines not dashes.)
>They could be called shallow square-wave patterns that fill the
>whole window.
Possibly the result of some glitched program code writing
alternating 01 patterns into the video memory. It would have to be kernel
code (or a corrupted MMU register) to allow writing to the video ram
directly. If you are getting power supply glitches, anything is possible.
>I opened the machine again to expose the FD, HD and Power Supply
>and noticed that the GREEN ground wire from the switch block
>to the back corner of the power supply was held by a loose
>screw! It was not disconnected just loose. I tighted that screw
>then examined the other wires and cables. The cable to the monitor
>has an indentation caused by the HD and the screw that should hold
>it to the frame on the left side was missing. The other wires
>look OK.
It probably would have been better without the wire making any
contact at all. :-) Intermittent connections (even to ground on the input to
the power supply), can generate strange bugs.
>Without closing the machine, I reattached the keyboard and turned
>the 3b1 on. Two pencils separate the keyboard from the
>metal platform where it would usually be when packed.
>The monitor faces the ceiling with space allowed for
>the fan to function. THE MACHINE BOOTED AND HAS BEEN
>RUNNING SINCE--ABOUT 40 CONTINUOUS HOURS SO FAR. I have run
>a number a tasks on the machine, including I/O via the floppy
>drive. I'll start running the diagnostic disk to test the
>memory soon.
I agree with the other poster that this should not be done as
standard practice, (though I consider it a form of stress test to find
marginal components, if any). At this point, you should add some extra
airflow over the plate and power supply to avoid generating premature
failure of components like capacitors and the battery on the cpu board. The
design of the box plus the cover is such that some of the air that exits via
the fan if forced to go through the box over the cpu and under the plate,
and sweep up behind/between the drives. I consider short-term operation
with the case opened to be reasonable, but I generally try to button the
machine up after, perhaps, the time required to format and test a hard disk
drive.
>The metal plate below the keyboard is running warm. The CPU
>is surely just as hot as when the hood is closed. The fan
>seems to be working well and there was no indications of
>overheating when the shell was closed. This suggests that
>it is probably not a temperature-sensitive problem. It may
>be related to a crimped cable or poor grounding.
The impression that I got from your description was that the fan is
still in the top, and has simply been propped up enough to allow airflow
through the fan itself. This doesn't really cool anything other than the
fan motor.
>The loose ground wire must have been like using a two prong
>adaptor plug to defeat the grounding prong. COULD or DOES
>POOR GROUNDING CAUSE PANIC PROBLEMS? COULD INTERMITTENT
>CONTACT BETWEEN COMPUTER AND GROUND CAUSE PROBLEMS?
Sure could. It is more likely if you are connected to other devices
through the parallel or the rs232 ports, but it is possible in other cases
as well. HOWEVER, another point to consider: Did you disconnect the D.C.
connector to the power supply and open up the top before running these
tests? If so, it still could be an intermittent (oxidized) contact on the
D.C. connector. If you can get Cramolin (there aren't many dealers, since
they seem to have rather overkill in stocking requirements), you should
treat the power connector with it. (Use Cramolin Red (R5), since it both
cleans and protects. The Blue is primarily for protection of already
clean contacts. If you cant' get that, get some other contact cleaner,
spray (or apply in some other manner), and then slide the connector on and
off several times to break down the oxide film. I did this (with Cramolin)
to the machine which I just got, even before powering it up. The connector
showed no localized browning on that one, and now I don't expect it ever to.
I hope that your problem stays away.
Good Luck
DoN.
--
Donald Nichols (DoN.) | Voice (Days): (703) 704-2280 (Eves): (703) 938-4564
D&D Data | Email: <dnichols@ceilidh.beartrack.com>
I said it - no one else| <nichols@nvl.army.mil>
--- Black Holes are where God is dividing by zero ---
Tutorials
=========
/bin/sh Shell Programming - Part 4 (LRARK) Ricky Mobley
----------------------------------
This is the fourth and final part of this series. In the last part we
covered more of the basics and got into quoting. If you missed reading it,
I suggest you go back and review before continuing to press forward. The
basics are important and will help you discover the heart of this and any
other sequence.
Last issue we experimented with command substitution, quoting mechanisms,
redirection, I/O and worked with control commands. This issue we will work
with some built-in commands and flags to the shell.
: Does nothing. This is a null command which returns
a zero exit value.
The only time I use this is when I want to monitor a process on the fly.
$ while : <- while true
> do
> ps -ef <- do some command here
> sleep 10 <- wait 10 seconds
> done <- execute (must hit DEL to interrupt this loop)
. file Reads and executes commands from file and returns.
It does not spawn a subshell but does follow the
search path specified by PATH (your environment
variable).
I found this command to be very useful. NOTE: It does not spawn a subshell.
That means I can use this command to modify my current shell. Try this:
Create a file that contains a one-liner as follows:
cd /usr/spool/uucppublic
Call the file pspool and 'chmod +x pspool' to make it executable. Now lets go.
$ pwd <- lets see where we are
/usr/rick/News/comp <- our current directory
$ pspool <- execute the program
$ pwd <- and see where we are
/usr/rick/News/comp <- we didn't appear to move
$ . pspool <- execute it again with '.' leading command
$ pwd <- and see where we are
/usr/spool/uucppublic <- success!!
$
The program 'pspool' actually did change our directory, but it happened in a
subshell and when the program exited, so did the subshell and our current
shell was entered just how we left it. Can you think of some valuable uses
for this command?
break [n] Exits from the enclosing for, while, or until loop.
If n is specified, then breaks n levels.
continue [n] Resumes the next iteration of the enclosing for,
while, or until loop. If n is specified, resumes at
the nth enclosing loop.
cd [dir] Changes the current directory to dir. If dir is not
specified the shell variable HOME is the default.
eval [arg ...] Reads arguments as input to the shell and executes
the resulting commands.
exec [arg ...] Executes the command specified by argument in place
of this shell without creating a new process.
exit [n] Causes a shell to exit with the exit value specified
by n. If n is not specified, the exit value is that
of the last command executed.
export [name ...] Marks the specified names for automatic export
to the environments of later executed commands.
If you do not specify names, export displays a
list of all names that are exported in this shell.
newgrp [arg . . .] Changes your primary group identification to arg.
If arg is not specified, it changes your primary
group back to your original login group.
read [name . . .] We covered this last issue: Reads one line from
standard input. Assigns the first word in the
line to the first name, the second word to the
second name, etc.
readonly [name . . .] Marks the specified names readonly. The values
of these names cannot be reset. If name is not
specified, readonly displays a list of all readonly
names.
set [flag ...[arg]...] -e Exits immediately if a command exits with
a nonzero exit value.
-k Places all keyword parameters in the
environment for a command, not just
those that precede the command name.
-n Reads commands but do not execute them.
-u Treats an unset variable as an error when
performing variable substitution.
-v Displays shell input lines as they are read.
-x Displays commands and their arguments as
they are executed.
-- Does not change any of the flags. This is
useful in setting $i to a string beginning
with a - (minus).
Using a + (plus) rather than a - (minus) unsets
flags. The special variable $- contains the current
set of flags.
Any arguments to set are positional parameters and
are assigned to $1, $2, etc. If no flags or
parameters are specified, set displays all names.
shift [n] Shifts command line arguments to the left assigning
$2 to $1, $3 to $2, etc. If n is specified, you
will achieve n consecutive shifts. The default value
of n is 1.
To try 'shift' enter the following, making it executable (chmod +x filename):
echo $1
shift
echo $1
shift
echo $1
shift
echo $1
Then test it:
$ shft
1 2 3 4
1
2
3
4
$
It worked, right?
test expr | [expr] Evaluates conditional expressions.
times Displays the accumulated user and system times for
processes run from the shell.
trap [arg] [n] . . . Runs the command specified by arg when the shell
receives signals n.
Common signals
SIGINT 02 Interrupt
SIGQUIT 03 Quit
SIGKILL 09 Kill (cannot be caught or ignored)
SIGALRM 14 Alarm clock
SIGTERM 15 Software termination signal
SIGUSR1 16 User-defined signal 1
SIGUSR2 17 User-defined signal 2
trap BREAK 2
BREAK()
{
echo '>>> \c'
while read _LINE
do
eval "$_LINE"
echo '>>> \c'
done
}
Now when we hit ^C (generating a SIGINT) we execute this part of the script.
Check your stty settings to see which key INT is defined to be.
ulimit [-f] [n] Imposes a size limit of n. The -f flag imposes a
size limit of n blocks on files written by the
child processes.
umask [nnn] Sets the user file-creation mask to nnn.
wait [n] Waits for the child process whose process number
is n to end and reports its termination status.
There are a few additional flags that are interpreted by the shell only
when you call it. Those flags are:
-c cmdstring Runs commands read from cmdstring. The shell does not read
additional commands from standard input when you specify
this flag.
-i Makes the shell interactive.
-r Creates a restricted shell.
-s Reads commands from standard input.
-t Reads and executes a single command and exits the shell.
There are several good books to read about shell programming, and I think
every good bookshelf should have at least two of these references.
UNIX Shell Programming - Kochan, Stephen G. & Wood, Patrick H. -
Hayden Book Company - 1985, pp 422 - ISBN 0-8104-6309-1 - $24.95.
Exploring the UNIX System - Kochan, Stephen G. & Wood, Patrick H. -
Hayden Book Company - 1984, pp 370 - ISBN 0-8104-6268-0 - $22.95.
The UNIX C Shell Field Guide - Anderson, Gail & Anderson, Paul -
Prentice- Hall - 1986, pp 374 - ISBN 0-13-937468-X - $31.00.
Advanced UNIX: A Programmer's Guide - Prata, Stephen -
Howard W. Sams & Co. - 1985, pp 484 - ISBN 0-067-22403-8 - $24.95.
I enjoy working with the Bourne Shell, and I find that I use shells every
day. I also learned a new trick that I want to share with you. Start all
of your scripts like this:
#!/bin/sh
# @(#) chkmail 1.0 92/10/01
# @(#) To check for new mail from a command line.
# Author: Ricky Mobley
# Version: 1.0
# Purpose: To check for new mail from a command line.
The first line hopefully insures that you will be running the Bourne Shell.
The second line works with the 'what' command and will pass that line
to you just like it does with compiled '.c' programs. Neat, huh? Lets try it.
$ what *
addyear:
addyear.c 1.0 92/08/30
addyear.c:
addyear.c 1.0 92/08/30
chkmail:
chkmail 1.0 92/10/01
To check for new mail from a command line.
noslash:
noslash.c 1.0 91/12/09
noslash.c:
noslash.c 1.0 91/12/09
$ exit
lrark!login:
NOTE: This is the last part of this series of articles on Bourne Shell
programming. I'll leave the rest to your imagination......
Ricky Mobley [lrark]
Little Rock, AR
----------
---------------
REMINDER - This newsletter is being sent to you 'by request'. If you do
not wish to keep receiving it, e-mail a stop notice to GARS. On the other
hand, we would very much appreciate it if you would pass the word that we
do distribute this item near the tenth (10th) of the month of issue to any-
one on GEnie who requests it.
P L E A S E also remember contributions are most welcome. Please e-mail
items and/or suggestions to GARS.
(EOF)
Trademark and Copyright notices:
Unix is a Trademark of UNIX System Laboratories, Inc.; GEnie, LiveWire, and
RoundTable are Trademarks of General Electric Information Services Company;
Xenix and ms-dos are Trademarks of Microsoft Corporation; NeXT NeXTstation
and NeXTstep are Trademarks of NeXT Computer Systems, Inc., Coherent is a
Trademark of Mark Williams Company, Sun, SPARC, SunOS are Trademarks of Sun
Microsystems, Inc., SCO is a Trademark of Santa Cruz Operations.
The contents of this newsletter are copyright(c) 1992 and may be copied whole
or in part only if original credit is included. The GEnie UNIX RoundTable is
not affiliated with AT&T or UNIX System Laboratories, Inc.